# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.DFAReporting.V4.Model.File do
  @moduledoc """
  Represents a File resource. A file contains the metadata for a report run. It shows the status of the run and holds the URLs to the generated report data if the run is finished and the status is "REPORT_AVAILABLE".

  ## Attributes

  *   `dateRange` (*type:* `GoogleApi.DFAReporting.V4.Model.DateRange.t`, *default:* `nil`) - The date range for which the file has report data. The date range will always be the absolute date range for which the report is run.
  *   `etag` (*type:* `String.t`, *default:* `nil`) - Etag of this resource.
  *   `fileName` (*type:* `String.t`, *default:* `nil`) - The filename of the file.
  *   `format` (*type:* `String.t`, *default:* `nil`) - The output format of the report. Only available once the file is available.
  *   `id` (*type:* `String.t`, *default:* `nil`) - The unique ID of this report file.
  *   `kind` (*type:* `String.t`, *default:* `nil`) - Identifies what kind of resource this is. Value: the fixed string "dfareporting#file".
  *   `lastModifiedTime` (*type:* `String.t`, *default:* `nil`) - The timestamp in milliseconds since epoch when this file was last modified.
  *   `reportId` (*type:* `String.t`, *default:* `nil`) - The ID of the report this file was generated from.
  *   `status` (*type:* `String.t`, *default:* `nil`) - The status of the report file.
  *   `urls` (*type:* `GoogleApi.DFAReporting.V4.Model.FileUrls.t`, *default:* `nil`) - The URLs where the completed report file can be downloaded.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :dateRange => GoogleApi.DFAReporting.V4.Model.DateRange.t() | nil,
          :etag => String.t() | nil,
          :fileName => String.t() | nil,
          :format => String.t() | nil,
          :id => String.t() | nil,
          :kind => String.t() | nil,
          :lastModifiedTime => String.t() | nil,
          :reportId => String.t() | nil,
          :status => String.t() | nil,
          :urls => GoogleApi.DFAReporting.V4.Model.FileUrls.t() | nil
        }

  field(:dateRange, as: GoogleApi.DFAReporting.V4.Model.DateRange)
  field(:etag)
  field(:fileName)
  field(:format)
  field(:id)
  field(:kind)
  field(:lastModifiedTime)
  field(:reportId)
  field(:status)
  field(:urls, as: GoogleApi.DFAReporting.V4.Model.FileUrls)
end

defimpl Poison.Decoder, for: GoogleApi.DFAReporting.V4.Model.File do
  def decode(value, options) do
    GoogleApi.DFAReporting.V4.Model.File.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.DFAReporting.V4.Model.File do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
